package com.lt.flashcard.model.entity;

import java.util.Date;

import org.bson.types.ObjectId;

import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Id;

@Entity(value="notification", noClassnameStored=true)
public class Notification {

	@Id
	private ObjectId id;
	
	/**
	 * Store the message
	 */
	private String message;
	
	/**
	 * The date that happen this notification
	 */
	private Date created = new Date();
	
	/**
	 * The type of this notification
	 */
	private int type = TYPE_SYSTEM;
	
	public static final int TYPE_SYSTEM = 0;
	public static final int TYPE_RATING = 1;
	public static final int TYPE_FRIENDREQUEST = 2;
	public static final int TYPE_COMMENT = 3;
	public static final int TYPE_REPLYCOMMENT = 4;
	public static final int TYPE_SHARE = 5;
	public static final int TYPE_PRIVATEMSG = 6;
	public static final int TYPE_ACCEPTEDFRIENDREQUEST = 7;
	public static final int TYPE_GETMEDAL = 8;
	
	/**
	 * Status of notification
	 */
	private int status = STATUS_UNREAD;
	
	public static final int STATUS_UNREAD = 0;
	public static final int STATUS_READ = 1;
	public static final int STATUS_ACCEPTEDFRIENDREQUEST = 2;
	
	private Long sourceuid = new Long(0);
	private Long targetuid = new Long(0);//The object that affected
	private Long relatedid = new Long(0);
	private String relatedidstr = "";//The related object that store in mongo
	
	private String sourceuname = null;
	private String relatedname = null;
	/**
	 * Image id that display for this notification
	 */
	private String imageid = "";
	/**
	 * Store extra data for this notification
	 */
	private String data = "";
	
	public ObjectId getId() {
		return id;
	}
	
	public void setId(ObjectId id) {
		this.id = id;
	}
	
	public String getMessage() {
		return message;
	}
	
	public void setMessage(String message) {
		this.message = message;
	}
	
	public Date getCreated() {
		return created;
	}
	
	public void setCreated(Date created) {
		this.created = created;
	}
	
	public int getType() {
		return type;
	}
	
	public void setType(int type) {
		this.type = type;
	}
	
	public Long getSourceuid() {
		return sourceuid;
	}
	
	public void setSourceuid(Long sourceuid) {
		this.sourceuid = sourceuid;
	}
	
	public Long getTargetuid() {
		return targetuid;
	}
	
	public void setTargetuid(Long targetuid) {
		this.targetuid = targetuid;
	}
	
	public Long getRelatedid() {
		return relatedid;
	}
	
	public void setRelatedid(Long relatedid) {
		this.relatedid = relatedid;
	}
	
	public String getImageid() {
		return imageid;
	}
	
	public void setImageid(String imageid) {
		this.imageid = imageid;
	}
	
	public String getData() {
		return data;
	}
	
	public void setData(String data) {
		this.data = data;
	}

	public int getStatus() {
    	return status;
    }

	public void setStatus(int status) {
    	this.status = status;
    }

	public String getSourceuname() {
    	return sourceuname;
    }

	public void setSourceuname(String sourceuname) {
    	this.sourceuname = sourceuname;
    }

	public String getRelatedname() {
    	return relatedname;
    }

	public void setRelatedname(String relatedname) {
    	this.relatedname = relatedname;
    }

	public String getRelatedidstr() {
		return relatedidstr;
	}

	public void setRelatedidstr(String relatedidstr) {
		this.relatedidstr = relatedidstr;
	}
}
